package com.sofwin.controller;

import com.github.pagehelper.PageInfo;
import com.sofwin.Constants;
import com.sofwin.dto.CinformationDto;
import com.sofwin.pojo.CInformation;
import com.sofwin.pojo.CInformationWithBLOBs;
import com.sofwin.service.CinformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @program: ssm-parent
 * @description: TODO
 * @author: Mr.Gao
 * @create: 2021-04-23 15:52
 **/
@Controller
@RequestMapping("information")
public class Cinformation {

    @Autowired
    CinformationService cinformationService;

    /**
    * @Description: 分页查询企业数据管理信息
    * @param cInformation: 实体类
    * @param pageNumber: 当前页码
    * @param pageSize: 每页显示的条数
    * @param model: 作用域
    * @return: String
    * @Author: Mr.Gao
    * @Date: 2021/4/23
    */
    @RequestMapping("data")
    public String data(CinformationDto cInformation, @RequestParam(required = true,defaultValue = "1") Integer pageNumber, @RequestParam(required = true,defaultValue = Constants.DEFAULT_PAGE_SIZE) Integer pageSize, Model model){
        PageInfo<CinformationDto> page = cinformationService.selectCinformationByPage(cInformation,pageNumber,pageSize);
        model.addAttribute("data",page.getList());
        model.addAttribute("page",page);
        model.addAttribute("user",cInformation);
        return "c_information/company";
    }






}
